{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "wine_PCA.ipynb",
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 419
        },
        "id": "AoO6aygVs0dc",
        "outputId": "07ffd348-a864-43f7-a05c-66bb42471404"
      },
      "source": [
        "import pandas as pd\r\n",
        "\r\n",
        "#importing dataset\r\n",
        "X = pd.read_csv('/content/drive/My Drive/Colab Notebooks/Projects/20200528_Wine_Classifier/wine_data.csv')\r\n",
        "X"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Wine</th>\n",
              "      <th>Alcohol</th>\n",
              "      <th>Malic Acid</th>\n",
              "      <th>Ash</th>\n",
              "      <th>Alcalinity of ash</th>\n",
              "      <th>Magnesium</th>\n",
              "      <th>Total phenols</th>\n",
              "      <th>Flavanoids</th>\n",
              "      <th>Nonflavanoids phenols</th>\n",
              "      <th>Proanthocyanins</th>\n",
              "      <th>Color Intensity</th>\n",
              "      <th>Hue</th>\n",
              "      <th>OD280/OD315 of diluted wines</th>\n",
              "      <th>Proline</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>14.23</td>\n",
              "      <td>1.71</td>\n",
              "      <td>2.43</td>\n",
              "      <td>15.6</td>\n",
              "      <td>127</td>\n",
              "      <td>2.80</td>\n",
              "      <td>3.06</td>\n",
              "      <td>0.28</td>\n",
              "      <td>2.29</td>\n",
              "      <td>5.64</td>\n",
              "      <td>1.04</td>\n",
              "      <td>3.92</td>\n",
              "      <td>1065</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>1</td>\n",
              "      <td>13.20</td>\n",
              "      <td>1.78</td>\n",
              "      <td>2.14</td>\n",
              "      <td>11.2</td>\n",
              "      <td>100</td>\n",
              "      <td>2.65</td>\n",
              "      <td>2.76</td>\n",
              "      <td>0.26</td>\n",
              "      <td>1.28</td>\n",
              "      <td>4.38</td>\n",
              "      <td>1.05</td>\n",
              "      <td>3.40</td>\n",
              "      <td>1050</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>1</td>\n",
              "      <td>13.16</td>\n",
              "      <td>2.36</td>\n",
              "      <td>2.67</td>\n",
              "      <td>18.6</td>\n",
              "      <td>101</td>\n",
              "      <td>2.80</td>\n",
              "      <td>3.24</td>\n",
              "      <td>0.30</td>\n",
              "      <td>2.81</td>\n",
              "      <td>5.68</td>\n",
              "      <td>1.03</td>\n",
              "      <td>3.17</td>\n",
              "      <td>1185</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>1</td>\n",
              "      <td>14.37</td>\n",
              "      <td>1.95</td>\n",
              "      <td>2.50</td>\n",
              "      <td>16.8</td>\n",
              "      <td>113</td>\n",
              "      <td>3.85</td>\n",
              "      <td>3.49</td>\n",
              "      <td>0.24</td>\n",
              "      <td>2.18</td>\n",
              "      <td>7.80</td>\n",
              "      <td>0.86</td>\n",
              "      <td>3.45</td>\n",
              "      <td>1480</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>1</td>\n",
              "      <td>13.24</td>\n",
              "      <td>2.59</td>\n",
              "      <td>2.87</td>\n",
              "      <td>21.0</td>\n",
              "      <td>118</td>\n",
              "      <td>2.80</td>\n",
              "      <td>2.69</td>\n",
              "      <td>0.39</td>\n",
              "      <td>1.82</td>\n",
              "      <td>4.32</td>\n",
              "      <td>1.04</td>\n",
              "      <td>2.93</td>\n",
              "      <td>735</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>173</th>\n",
              "      <td>3</td>\n",
              "      <td>13.71</td>\n",
              "      <td>5.65</td>\n",
              "      <td>2.45</td>\n",
              "      <td>20.5</td>\n",
              "      <td>95</td>\n",
              "      <td>1.68</td>\n",
              "      <td>0.61</td>\n",
              "      <td>0.52</td>\n",
              "      <td>1.06</td>\n",
              "      <td>7.70</td>\n",
              "      <td>0.64</td>\n",
              "      <td>1.74</td>\n",
              "      <td>740</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>174</th>\n",
              "      <td>3</td>\n",
              "      <td>13.40</td>\n",
              "      <td>3.91</td>\n",
              "      <td>2.48</td>\n",
              "      <td>23.0</td>\n",
              "      <td>102</td>\n",
              "      <td>1.80</td>\n",
              "      <td>0.75</td>\n",
              "      <td>0.43</td>\n",
              "      <td>1.41</td>\n",
              "      <td>7.30</td>\n",
              "      <td>0.70</td>\n",
              "      <td>1.56</td>\n",
              "      <td>750</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>175</th>\n",
              "      <td>3</td>\n",
              "      <td>13.27</td>\n",
              "      <td>4.28</td>\n",
              "      <td>2.26</td>\n",
              "      <td>20.0</td>\n",
              "      <td>120</td>\n",
              "      <td>1.59</td>\n",
              "      <td>0.69</td>\n",
              "      <td>0.43</td>\n",
              "      <td>1.35</td>\n",
              "      <td>10.20</td>\n",
              "      <td>0.59</td>\n",
              "      <td>1.56</td>\n",
              "      <td>835</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>176</th>\n",
              "      <td>3</td>\n",
              "      <td>13.17</td>\n",
              "      <td>2.59</td>\n",
              "      <td>2.37</td>\n",
              "      <td>20.0</td>\n",
              "      <td>120</td>\n",
              "      <td>1.65</td>\n",
              "      <td>0.68</td>\n",
              "      <td>0.53</td>\n",
              "      <td>1.46</td>\n",
              "      <td>9.30</td>\n",
              "      <td>0.60</td>\n",
              "      <td>1.62</td>\n",
              "      <td>840</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>177</th>\n",
              "      <td>3</td>\n",
              "      <td>14.13</td>\n",
              "      <td>4.10</td>\n",
              "      <td>2.74</td>\n",
              "      <td>24.5</td>\n",
              "      <td>96</td>\n",
              "      <td>2.05</td>\n",
              "      <td>0.76</td>\n",
              "      <td>0.56</td>\n",
              "      <td>1.35</td>\n",
              "      <td>9.20</td>\n",
              "      <td>0.61</td>\n",
              "      <td>1.60</td>\n",
              "      <td>560</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>178 rows × 14 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "     Wine  Alcohol  Malic Acid  ...   Hue  OD280/OD315 of diluted wines  Proline\n",
              "0       1    14.23        1.71  ...  1.04                          3.92     1065\n",
              "1       1    13.20        1.78  ...  1.05                          3.40     1050\n",
              "2       1    13.16        2.36  ...  1.03                          3.17     1185\n",
              "3       1    14.37        1.95  ...  0.86                          3.45     1480\n",
              "4       1    13.24        2.59  ...  1.04                          2.93      735\n",
              "..    ...      ...         ...  ...   ...                           ...      ...\n",
              "173     3    13.71        5.65  ...  0.64                          1.74      740\n",
              "174     3    13.40        3.91  ...  0.70                          1.56      750\n",
              "175     3    13.27        4.28  ...  0.59                          1.56      835\n",
              "176     3    13.17        2.59  ...  0.60                          1.62      840\n",
              "177     3    14.13        4.10  ...  0.61                          1.60      560\n",
              "\n",
              "[178 rows x 14 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 50
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "OS1MizbztR6k",
        "outputId": "5db8049a-149b-4f63-9099-aa268b5cb25c"
      },
      "source": [
        "y = X.pop('Wine')\r\n",
        "y"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "0      1\n",
              "1      1\n",
              "2      1\n",
              "3      1\n",
              "4      1\n",
              "      ..\n",
              "173    3\n",
              "174    3\n",
              "175    3\n",
              "176    3\n",
              "177    3\n",
              "Name: Wine, Length: 178, dtype: int64"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 51
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "MVCxExBxv_gW",
        "outputId": "76117807-ca38-4134-f317-6fbce1574b51"
      },
      "source": [
        "k = list(y).copy()\r\n",
        "k"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 1,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 2,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3,\n",
              " 3]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 54
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "30jpjmJvtBzD",
        "outputId": "b3d49160-c034-4fb0-d4b8-358c464ffaa0"
      },
      "source": [
        "import numpy as np\r\n",
        "from sklearn.model_selection import train_test_split\r\n",
        "\r\n",
        "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)\r\n",
        "print(X_train.shape, X_test.shape, y_train.shape, y_test.shape)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "(119, 13) (59, 13) (119,) (59,)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "vut3AO1VtoEv",
        "outputId": "25849a71-bb88-490e-8640-8f1f6d9709ff"
      },
      "source": [
        "#GaussianNB\r\n",
        "from sklearn.naive_bayes import GaussianNB\r\n",
        "\r\n",
        "clf = GaussianNB()\r\n",
        "clf = clf.fit(X_train, y_train)\r\n",
        "\r\n",
        "y_predict = clf.predict(X_test)\r\n",
        "\r\n",
        "from sklearn.metrics import accuracy_score\r\n",
        "print(accuracy_score(y_test, y_predict))"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "1.0\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "6-2r03A3trWD",
        "outputId": "aa686bd7-381b-476e-cd5e-37f0b406e230"
      },
      "source": [
        "#RandomForestClassifier\r\n",
        "from sklearn.ensemble import RandomForestClassifier\r\n",
        "clf = RandomForestClassifier(n_estimators=10)\r\n",
        "clf = clf.fit(X_train, y_train)\r\n",
        "y_predict = clf.predict(X_test)\r\n",
        "from sklearn.metrics import accuracy_score\r\n",
        "print(accuracy_score(y_test, y_predict))"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "0.9661016949152542\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "6t8eRaaituEe",
        "outputId": "fe9caa7a-ea08-40eb-a6a9-89cbf36cf83c"
      },
      "source": [
        "#cross validation\r\n",
        "from sklearn.model_selection import cross_val_score\r\n",
        "\r\n",
        "scores = cross_val_score(clf, X, y, cv=5)\r\n",
        "scores"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([0.94444444, 0.97222222, 0.97222222, 0.94285714, 1.        ])"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 24
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 436
        },
        "id": "2XE37artu406",
        "outputId": "af84183f-6fd5-4b78-e2c2-e6448e945de6"
      },
      "source": [
        "from sklearn.preprocessing import MinMaxScaler\r\n",
        "\r\n",
        "scaler = MinMaxScaler()\r\n",
        "scaler.fit(X)\r\n",
        "\r\n",
        "X_ = pd.DataFrame(scaler.transform(X))\r\n",
        "X_.columns = X.columns\r\n",
        "X_"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Alcohol</th>\n",
              "      <th>Malic Acid</th>\n",
              "      <th>Ash</th>\n",
              "      <th>Alcalinity of ash</th>\n",
              "      <th>Magnesium</th>\n",
              "      <th>Total phenols</th>\n",
              "      <th>Flavanoids</th>\n",
              "      <th>Nonflavanoids phenols</th>\n",
              "      <th>Proanthocyanins</th>\n",
              "      <th>Color Intensity</th>\n",
              "      <th>Hue</th>\n",
              "      <th>OD280/OD315 of diluted wines</th>\n",
              "      <th>Proline</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>0.842105</td>\n",
              "      <td>0.191700</td>\n",
              "      <td>0.572193</td>\n",
              "      <td>0.257732</td>\n",
              "      <td>0.619565</td>\n",
              "      <td>0.627586</td>\n",
              "      <td>0.573840</td>\n",
              "      <td>0.283019</td>\n",
              "      <td>0.593060</td>\n",
              "      <td>0.372014</td>\n",
              "      <td>0.455285</td>\n",
              "      <td>0.970696</td>\n",
              "      <td>0.561341</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>0.571053</td>\n",
              "      <td>0.205534</td>\n",
              "      <td>0.417112</td>\n",
              "      <td>0.030928</td>\n",
              "      <td>0.326087</td>\n",
              "      <td>0.575862</td>\n",
              "      <td>0.510549</td>\n",
              "      <td>0.245283</td>\n",
              "      <td>0.274448</td>\n",
              "      <td>0.264505</td>\n",
              "      <td>0.463415</td>\n",
              "      <td>0.780220</td>\n",
              "      <td>0.550642</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>0.560526</td>\n",
              "      <td>0.320158</td>\n",
              "      <td>0.700535</td>\n",
              "      <td>0.412371</td>\n",
              "      <td>0.336957</td>\n",
              "      <td>0.627586</td>\n",
              "      <td>0.611814</td>\n",
              "      <td>0.320755</td>\n",
              "      <td>0.757098</td>\n",
              "      <td>0.375427</td>\n",
              "      <td>0.447154</td>\n",
              "      <td>0.695971</td>\n",
              "      <td>0.646933</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>0.878947</td>\n",
              "      <td>0.239130</td>\n",
              "      <td>0.609626</td>\n",
              "      <td>0.319588</td>\n",
              "      <td>0.467391</td>\n",
              "      <td>0.989655</td>\n",
              "      <td>0.664557</td>\n",
              "      <td>0.207547</td>\n",
              "      <td>0.558360</td>\n",
              "      <td>0.556314</td>\n",
              "      <td>0.308943</td>\n",
              "      <td>0.798535</td>\n",
              "      <td>0.857347</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>0.581579</td>\n",
              "      <td>0.365613</td>\n",
              "      <td>0.807487</td>\n",
              "      <td>0.536082</td>\n",
              "      <td>0.521739</td>\n",
              "      <td>0.627586</td>\n",
              "      <td>0.495781</td>\n",
              "      <td>0.490566</td>\n",
              "      <td>0.444795</td>\n",
              "      <td>0.259386</td>\n",
              "      <td>0.455285</td>\n",
              "      <td>0.608059</td>\n",
              "      <td>0.325963</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>173</th>\n",
              "      <td>0.705263</td>\n",
              "      <td>0.970356</td>\n",
              "      <td>0.582888</td>\n",
              "      <td>0.510309</td>\n",
              "      <td>0.271739</td>\n",
              "      <td>0.241379</td>\n",
              "      <td>0.056962</td>\n",
              "      <td>0.735849</td>\n",
              "      <td>0.205047</td>\n",
              "      <td>0.547782</td>\n",
              "      <td>0.130081</td>\n",
              "      <td>0.172161</td>\n",
              "      <td>0.329529</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>174</th>\n",
              "      <td>0.623684</td>\n",
              "      <td>0.626482</td>\n",
              "      <td>0.598930</td>\n",
              "      <td>0.639175</td>\n",
              "      <td>0.347826</td>\n",
              "      <td>0.282759</td>\n",
              "      <td>0.086498</td>\n",
              "      <td>0.566038</td>\n",
              "      <td>0.315457</td>\n",
              "      <td>0.513652</td>\n",
              "      <td>0.178862</td>\n",
              "      <td>0.106227</td>\n",
              "      <td>0.336662</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>175</th>\n",
              "      <td>0.589474</td>\n",
              "      <td>0.699605</td>\n",
              "      <td>0.481283</td>\n",
              "      <td>0.484536</td>\n",
              "      <td>0.543478</td>\n",
              "      <td>0.210345</td>\n",
              "      <td>0.073840</td>\n",
              "      <td>0.566038</td>\n",
              "      <td>0.296530</td>\n",
              "      <td>0.761092</td>\n",
              "      <td>0.089431</td>\n",
              "      <td>0.106227</td>\n",
              "      <td>0.397290</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>176</th>\n",
              "      <td>0.563158</td>\n",
              "      <td>0.365613</td>\n",
              "      <td>0.540107</td>\n",
              "      <td>0.484536</td>\n",
              "      <td>0.543478</td>\n",
              "      <td>0.231034</td>\n",
              "      <td>0.071730</td>\n",
              "      <td>0.754717</td>\n",
              "      <td>0.331230</td>\n",
              "      <td>0.684300</td>\n",
              "      <td>0.097561</td>\n",
              "      <td>0.128205</td>\n",
              "      <td>0.400856</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>177</th>\n",
              "      <td>0.815789</td>\n",
              "      <td>0.664032</td>\n",
              "      <td>0.737968</td>\n",
              "      <td>0.716495</td>\n",
              "      <td>0.282609</td>\n",
              "      <td>0.368966</td>\n",
              "      <td>0.088608</td>\n",
              "      <td>0.811321</td>\n",
              "      <td>0.296530</td>\n",
              "      <td>0.675768</td>\n",
              "      <td>0.105691</td>\n",
              "      <td>0.120879</td>\n",
              "      <td>0.201141</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>178 rows × 13 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "      Alcohol  Malic Acid  ...  OD280/OD315 of diluted wines   Proline\n",
              "0    0.842105    0.191700  ...                      0.970696  0.561341\n",
              "1    0.571053    0.205534  ...                      0.780220  0.550642\n",
              "2    0.560526    0.320158  ...                      0.695971  0.646933\n",
              "3    0.878947    0.239130  ...                      0.798535  0.857347\n",
              "4    0.581579    0.365613  ...                      0.608059  0.325963\n",
              "..        ...         ...  ...                           ...       ...\n",
              "173  0.705263    0.970356  ...                      0.172161  0.329529\n",
              "174  0.623684    0.626482  ...                      0.106227  0.336662\n",
              "175  0.589474    0.699605  ...                      0.106227  0.397290\n",
              "176  0.563158    0.365613  ...                      0.128205  0.400856\n",
              "177  0.815789    0.664032  ...                      0.120879  0.201141\n",
              "\n",
              "[178 rows x 13 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 34
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "hpoHn-m4vgSp"
      },
      "source": [
        "df = X_"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "kDOjJnSkU7jS"
      },
      "source": [
        "from sklearn.decomposition import PCA\r\n",
        "import matplotlib.pyplot as plt\r\n",
        "\r\n",
        "pca = PCA(n_components=3)\r\n",
        "pca_result = pca.fit_transform(df)\r\n",
        "pca_result"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "3ecVt21jvp-8",
        "outputId": "e0e12710-b4bf-4c78-ec99-7b1c2a46f5b6"
      },
      "source": [
        "y"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[-0.2531927528570431,\n",
              " -0.008822891420635283,\n",
              " -0.18918722167748112,\n",
              " -0.5809055122572573,\n",
              " -0.05946657401511885,\n",
              " -0.48751919105438163,\n",
              " -0.3001964969263832,\n",
              " -0.2981970205924969,\n",
              " -0.30760285892123923,\n",
              " -0.2063282328858748,\n",
              " -0.3565120436091087,\n",
              " -0.22542453490427827,\n",
              " -0.23193813918262074,\n",
              " -0.3551386765713543,\n",
              " -0.5380478024650085,\n",
              " -0.33740538546788434,\n",
              " -0.4508426844199109,\n",
              " -0.3157503408790414,\n",
              " -0.5938813318982693,\n",
              " -0.17578223961142914,\n",
              " -0.1278310315853631,\n",
              " 0.009811275653937737,\n",
              " 0.0007824945226001646,\n",
              " 0.11378690097270135,\n",
              " 0.09837719740864784,\n",
              " 0.009262703313640389,\n",
              " -0.1554703849001588,\n",
              " -0.08973642622503131,\n",
              " -0.08805164793527782,\n",
              " -0.10460250195341556,\n",
              " -0.2584308843861455,\n",
              " -0.36115578796928455,\n",
              " -0.051494306415228716,\n",
              " -0.26861662987189816,\n",
              " -0.12141320164109395,\n",
              " -0.030309882187644053,\n",
              " -0.07612384058168048,\n",
              " -0.050330276265271874,\n",
              " 0.061677556269284416,\n",
              " -0.3138300614716684,\n",
              " -0.1295366226701521,\n",
              " -0.124830305999712,\n",
              " -0.23695158172967495,\n",
              " -0.0693158637483763,\n",
              " -0.004173057947185031,\n",
              " -0.36722106279438804,\n",
              " -0.3090004811654619,\n",
              " -0.19381063078197702,\n",
              " -0.293598970181061,\n",
              " -0.40827057904743863,\n",
              " -0.15307510382013395,\n",
              " -0.1895770743302309,\n",
              " -0.35288217293704865,\n",
              " -0.3754453668989082,\n",
              " -0.21758377506956675,\n",
              " -0.24735341160835445,\n",
              " -0.2961183816351736,\n",
              " -0.2541728605658239,\n",
              " -0.373626691948152,\n",
              " 0.4158976792119199,\n",
              " 0.23904205629752742,\n",
              " 0.11538704309110208,\n",
              " 0.1440583119913095,\n",
              " 0.35859130992800575,\n",
              " 0.43197061182508534,\n",
              " 0.17702523213525265,\n",
              " 0.24822150928239375,\n",
              " 0.4312816106917733,\n",
              " 0.026073907336809126,\n",
              " 0.31613448598540433,\n",
              " 0.1559164282464183,\n",
              " 0.2219976031710088,\n",
              " 0.19612961980322713,\n",
              " 0.0858331792398658,\n",
              " 0.27740631819933387,\n",
              " 0.4394992763827999,\n",
              " 0.3108163939948911,\n",
              " 0.32219131223197905,\n",
              " 0.1678572925065335,\n",
              " 0.2509418908718355,\n",
              " 0.649776371819141,\n",
              " 0.24911555691599716,\n",
              " 0.48725838850561604,\n",
              " -0.002725024136835588,\n",
              " 0.3833324230414263,\n",
              " 0.41816620764988566,\n",
              " 0.44469870118588906,\n",
              " 0.5582651484788466,\n",
              " 0.39186710281796605,\n",
              " 0.5203974830428042,\n",
              " 0.40796417519604944,\n",
              " 0.4142555350919909,\n",
              " 0.28074704333840356,\n",
              " 0.47071491736163307,\n",
              " 0.48206879980710693,\n",
              " 0.06683594716357412,\n",
              " 0.23321980205353254,\n",
              " 0.4464500454060712,\n",
              " 0.23922424661216518,\n",
              " 0.4056179514653565,\n",
              " 0.3833756761362843,\n",
              " 0.39156168626833293,\n",
              " 0.31689829836022326,\n",
              " 0.4868996464959605,\n",
              " 0.3799321186462674,\n",
              " 0.401936154740588,\n",
              " 0.4126791416751286,\n",
              " 0.2698325199677684,\n",
              " 0.45985230363266627,\n",
              " 0.39117920565241704,\n",
              " 0.2828274955146965,\n",
              " 0.38322539480144113,\n",
              " 0.2701939844952771,\n",
              " 0.5070218349708073,\n",
              " 0.456899550181211,\n",
              " 0.7775430928097289,\n",
              " 0.5591676321354117,\n",
              " 0.44289817393961656,\n",
              " 0.17117932001502587,\n",
              " 0.4113666783119903,\n",
              " 0.35964855596880213,\n",
              " 0.2433096368635006,\n",
              " 0.2684062682164063,\n",
              " 0.10259407256572342,\n",
              " 0.34824768903946257,\n",
              " 0.4433008872261179,\n",
              " 0.28912349703699414,\n",
              " 0.36904009791843895,\n",
              " 0.43037289870483897,\n",
              " 0.23311753907466548,\n",
              " -0.016305418220350656,\n",
              " -0.06851820579946101,\n",
              " -0.03875973249122147,\n",
              " -0.07800551962876753,\n",
              " 0.045560750486956306,\n",
              " -0.10578362491732249,\n",
              " -0.04072808405874707,\n",
              " -0.07820065501633273,\n",
              " -0.13388880697513048,\n",
              " 0.0005567425969721602,\n",
              " 0.005364615106248053,\n",
              " -0.09953057962150845,\n",
              " -0.047751635924446596,\n",
              " -0.13844376178229265,\n",
              " -0.22729822959369556,\n",
              " -0.15773925128884406,\n",
              " -0.2142313730015922,\n",
              " -0.2522675550636308,\n",
              " -0.32796291261241295,\n",
              " -0.3785551535365896,\n",
              " -0.38306205837908397,\n",
              " -0.33491737690072476,\n",
              " -0.19028041400974838,\n",
              " -0.44713570375960876,\n",
              " -0.08896154903287615,\n",
              " -0.39179846781314426,\n",
              " -0.41221174493543183,\n",
              " -0.20437147255980032,\n",
              " -0.6453058419559626,\n",
              " -0.44353227622160135,\n",
              " -0.1434592797963788,\n",
              " -0.22918727577779968,\n",
              " -0.046280519483056254,\n",
              " -0.1390748160018598,\n",
              " -0.3488683118506167,\n",
              " -0.22301853181583434,\n",
              " -0.476565598054751,\n",
              " -0.28876936739912284,\n",
              " -0.36078103169910525,\n",
              " -0.4159888034754323,\n",
              " 0.0657518883953786,\n",
              " -0.18191366037809142,\n",
              " -0.46240469629611225,\n",
              " -0.47190114948566714,\n",
              " -0.348365752315639,\n",
              " -0.546857013070591,\n",
              " -0.4255160867641201,\n",
              " -0.5135049826839481]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 47
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "3re-DTHXU2Pb",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 559
        },
        "outputId": "3e5a924d-0d1c-40eb-db79-b6d6aa446194"
      },
      "source": [
        "import plotly.express as px\r\n",
        "fig = plt.figure(figsize=(14, 8))\r\n",
        "\r\n",
        "x = list(pca_result[:,0])\r\n",
        "y = list(pca_result[:,1])\r\n",
        "z = list(pca_result[:,2])\r\n",
        "\r\n",
        "fig = px.scatter_3d(df, x=x, y=y, z=z, text=k, color=k)\r\n",
        "fig.show()"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>\n",
              "<head><meta charset=\"utf-8\" /></head>\n",
              "<body>\n",
              "    <div>\n",
              "            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script>\n",
              "                <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
              "        <script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>    \n",
              "            <div id=\"a5bb86b5-d149-4f7a-b5bb-c4d4dd08aa21\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div>\n",
              "            <script type=\"text/javascript\">\n",
              "                \n",
              "                    window.PLOTLYENV=window.PLOTLYENV || {};\n",
              "                    \n",
              "                if (document.getElementById(\"a5bb86b5-d149-4f7a-b5bb-c4d4dd08aa21\")) {\n",
              "                    Plotly.newPlot(\n",
              "                        'a5bb86b5-d149-4f7a-b5bb-c4d4dd08aa21',\n",
              "                        [{\"hoverlabel\": {\"namelength\": 0}, \"hovertemplate\": \"x=%{x}<br>y=%{y}<br>z=%{z}<br>text=%{text}<br>color=%{marker.color}\", \"legendgroup\": \"\", \"marker\": {\"color\": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], \"coloraxis\": \"coloraxis\", \"symbol\": \"circle\"}, \"mode\": \"markers+text\", \"name\": \"\", \"scene\": \"scene\", \"showlegend\": false, \"text\": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0], \"type\": \"scatter3d\", \"x\": [-0.7063357559739392, -0.4849768017717709, -0.5211722661289458, -0.821643663444925, -0.20254638157095559, -0.6081901521202477, -0.5440473986436283, -0.4743574954874905, -0.5004320119570952, -0.6275179686728707, -0.7274671570917972, -0.3749677438326426, -0.4481882828482035, -0.6263453286759273, -0.8357170112512712, -0.47193156797665553, -0.42699090502750464, -0.36659570355209, -0.7187885333456541, -0.45888498563963465, -0.6618522880381423, -0.2679000319538011, -0.5997823988279932, -0.4178947999370141, -0.44994039168693784, -0.21578779516971616, -0.41553199570253224, -0.2839469700735522, -0.4750992269650709, -0.5143964692959477, -0.5209658119510383, -0.575738232641883, -0.3021446388067235, -0.3670219714878797, -0.3030224681173565, -0.45833887764168635, -0.2715663247401238, -0.2320041887805354, -0.3054804033914176, -0.5196050330379149, -0.5305751143582873, -0.1870445255705316, -0.7055081974474842, -0.111517298776384, -0.4673606516641669, -0.2901228005049384, -0.5832593702171353, -0.6202790286065468, -0.3948223697924987, -0.5596201611830274, -0.631721342609359, -0.6194299068901973, -0.7310574664323584, -0.44637239109178845, -0.4722716860195448, -0.5265194748613798, -0.5809228376794257, -0.4564996599158443, -0.6686733057944837, 0.23661213113714685, 0.41108301720887425, 0.45346614505335175, -0.010290872329033647, -0.4536807083304108, 0.18588906899134117, -0.132514399811759, -0.481660732929306, -0.13735979016157512, 0.22015782906003156, -0.3450315443539117, 0.36794340841577133, -0.40832435073245504, 0.07542113153048358, -0.5992765569827562, -0.45956226089733004, 0.23186090313245947, -0.06493976550691234, 0.32373637061722166, -0.13392862208417589, -0.08634646139834716, -0.1874773155336052, -0.25358904005712046, 0.06459221211948163, 0.5685674885949312, -0.20755533034963486, -0.1848266490093047, 0.19460460862051732, 0.04979030896695363, 0.2019953778484325, 0.026001176962208567, 0.3207770296892703, 0.32143343188960016, 0.4415392325651483, -0.18381479869978704, -0.234623773126081, -0.39876299122205977, 0.13231103196963112, -0.20323743602639502, -0.4913021471676937, -0.22221150372245194, -0.17841514383960277, 0.08820370608907555, -0.045962789794468724, 0.12716525650965582, -0.16835980303232415, 0.3349418379301108, 0.03085597703086451, 0.3313382974160011, -0.032524867547102085, -0.3632618315966522, -0.2589286763573611, 0.0012212233284998512, 0.31115209876766486, 0.0992201563195356, 0.01873269992537545, -0.06137200742469829, -0.0253109370219555, 0.0012572931396184449, 0.5127375941420083, 0.09106422723684307, -0.2207087583527604, -0.3578556357217306, 0.19673686563053608, 0.04668325340771427, -0.27637958979607846, -0.058049497231616294, -0.05615699526178583, 0.3183515422114135, 0.06168944409587677, 0.3351132524074866, 0.33887840965882277, 0.5254733856918785, 0.6106086868117538, 0.47050330071118324, 0.5595223905602725, 0.7008876262838494, 0.8683670975045144, 0.8627809227377136, 0.6837495421095, 0.49071936490478646, 0.5694530981168106, 0.4246773520213907, 0.6156200304107536, 0.5221733294423371, 0.47761457176823796, 0.5796796573700418, 0.9152164456850012, 0.7367888443866019, 0.6038628408597828, 0.6542441347856425, 0.5208422627934147, 0.5496214180810591, 0.40608659520961377, 0.6678751564315833, 0.6267857981852096, 0.8170550870238474, 0.6509798715065896, 0.7134306265390639, 0.256575999481252, 0.37364251700162054, 0.6750120389737184, 0.5174846785558057, 0.6260695648780517, 0.5790085321158678, 0.6243756753192964, 0.7663497875788431, 0.5630111919890173, 0.6243889062673857, 0.47251420564408086, 0.4823933609376385, 0.6791822803564137, 0.7745303668726549, 0.537656393695777, 0.7395095026882134, 0.5817811389989136, 0.6263128876683177, 0.5729911024096552, 0.7017639971012216], \"y\": [-0.2531927528570431, -0.008822891420635283, -0.18918722167748112, -0.5809055122572573, -0.05946657401511885, -0.48751919105438163, -0.3001964969263832, -0.2981970205924969, -0.30760285892123923, -0.2063282328858748, -0.3565120436091087, -0.22542453490427827, -0.23193813918262074, -0.3551386765713543, -0.5380478024650085, -0.33740538546788434, -0.4508426844199109, -0.3157503408790414, -0.5938813318982693, -0.17578223961142914, -0.1278310315853631, 0.009811275653937737, 0.0007824945226001646, 0.11378690097270135, 0.09837719740864784, 0.009262703313640389, -0.1554703849001588, -0.08973642622503131, -0.08805164793527782, -0.10460250195341556, -0.2584308843861455, -0.36115578796928455, -0.051494306415228716, -0.26861662987189816, -0.12141320164109395, -0.030309882187644053, -0.07612384058168048, -0.050330276265271874, 0.061677556269284416, -0.3138300614716684, -0.1295366226701521, -0.124830305999712, -0.23695158172967495, -0.0693158637483763, -0.004173057947185031, -0.36722106279438804, -0.3090004811654619, -0.19381063078197702, -0.293598970181061, -0.40827057904743863, -0.15307510382013395, -0.1895770743302309, -0.35288217293704865, -0.3754453668989082, -0.21758377506956675, -0.24735341160835445, -0.2961183816351736, -0.2541728605658239, -0.373626691948152, 0.4158976792119199, 0.23904205629752742, 0.11538704309110208, 0.1440583119913095, 0.35859130992800575, 0.43197061182508534, 0.17702523213525265, 0.24822150928239375, 0.4312816106917733, 0.026073907336809126, 0.31613448598540433, 0.1559164282464183, 0.2219976031710088, 0.19612961980322713, 0.0858331792398658, 0.27740631819933387, 0.4394992763827999, 0.3108163939948911, 0.32219131223197905, 0.1678572925065335, 0.2509418908718355, 0.649776371819141, 0.24911555691599716, 0.48725838850561604, -0.002725024136835588, 0.3833324230414263, 0.41816620764988566, 0.44469870118588906, 0.5582651484788466, 0.39186710281796605, 0.5203974830428042, 0.40796417519604944, 0.4142555350919909, 0.28074704333840356, 0.47071491736163307, 0.48206879980710693, 0.06683594716357412, 0.23321980205353254, 0.4464500454060712, 0.23922424661216518, 0.4056179514653565, 0.3833756761362843, 0.39156168626833293, 0.31689829836022326, 0.4868996464959605, 0.3799321186462674, 0.401936154740588, 0.4126791416751286, 0.2698325199677684, 0.45985230363266627, 0.39117920565241704, 0.2828274955146965, 0.38322539480144113, 0.2701939844952771, 0.5070218349708073, 0.456899550181211, 0.7775430928097289, 0.5591676321354117, 0.44289817393961656, 0.17117932001502587, 0.4113666783119903, 0.35964855596880213, 0.2433096368635006, 0.2684062682164063, 0.10259407256572342, 0.34824768903946257, 0.4433008872261179, 0.28912349703699414, 0.36904009791843895, 0.43037289870483897, 0.23311753907466548, -0.016305418220350656, -0.06851820579946101, -0.03875973249122147, -0.07800551962876753, 0.045560750486956306, -0.10578362491732249, -0.04072808405874707, -0.07820065501633273, -0.13388880697513048, 0.0005567425969721602, 0.005364615106248053, -0.09953057962150845, -0.047751635924446596, -0.13844376178229265, -0.22729822959369556, -0.15773925128884406, -0.2142313730015922, -0.2522675550636308, -0.32796291261241295, -0.3785551535365896, -0.38306205837908397, -0.33491737690072476, -0.19028041400974838, -0.44713570375960876, -0.08896154903287615, -0.39179846781314426, -0.41221174493543183, -0.20437147255980032, -0.6453058419559626, -0.44353227622160135, -0.1434592797963788, -0.22918727577779968, -0.046280519483056254, -0.1390748160018598, -0.3488683118506167, -0.22301853181583434, -0.476565598054751, -0.28876936739912284, -0.36078103169910525, -0.4159888034754323, 0.0657518883953786, -0.18191366037809142, -0.46240469629611225, -0.47190114948566714, -0.348365752315639, -0.546857013070591, -0.4255160867641201, -0.5135049826839481], \"z\": [0.024092693181920415, -0.2804820475745329, 0.1962167362428154, 0.08110971721711102, 0.3002399411955104, -0.07543323207993574, -0.10507462094056023, -0.0028214930827169336, -0.23049361276917976, -0.11414793196478644, -0.05041994900411671, -0.2861340829276856, -0.16790805342414217, -0.0858356578895264, -0.11520294304674075, -0.07278216073260799, 0.05443655271939249, 0.053679051344557874, -0.09664755675402843, 0.046189018132288026, -0.012134229648664042, 0.26843396188888297, -0.003718254783521698, -0.03768131932859538, 0.11918478646117618, 0.4747449719194987, -0.0071174796106109346, -0.27160569214272934, 0.18662147166175064, -0.12047251637772291, 0.10897900779203537, -0.11326690752265221, -0.04322296778726747, 0.08599779668802605, -0.05016390701094424, 0.07903004251551704, -0.05054016954144115, -0.1464454448008731, -0.30086623141074786, 0.16767054984351473, 0.07987875900018739, 0.06658919955821022, -0.0027698711375071044, 0.1900465674950963, -0.012999301634350908, 0.2064613904574804, 0.16028315866639922, -0.08482394017334129, 0.01430538931535175, -0.05253998194198552, -0.2568937558032503, -0.06397051922053487, 0.021161196838714206, 0.01308968746306417, -0.16702979337570725, 0.03821784375387439, -0.034856318357957376, 0.003389697150603051, -0.06871725883506585, -0.8358210657761519, -0.3263476809788771, -0.339942569314574, -0.38928445372968845, -0.041591422921125665, -0.12013034752990648, -0.05753628408619492, -0.21133872123373615, -0.19393501265450586, -0.27259641777153404, -0.38219937539050597, -0.30683293112048265, 0.19639692574052134, -0.07801229622460312, 0.3602840360296923, -0.0531956187037521, -0.35648240499704364, -0.46878207432989943, -0.051461300811604875, -0.320328347333606, 0.4543378769550298, -0.15543555220419306, -0.08168312215767949, 0.00770465734616411, 0.24185959332034418, -0.033039030977108926, -0.16823351655450844, -0.04406826973026435, 0.18861497173223749, 0.10123389156486305, 0.07478900609940027, -0.06989671761064391, 0.017725558159635276, -0.07729749579626967, 0.1016663194747546, -0.03772368913555872, -0.013597706528911773, -0.10538052734799294, -0.1978383545315857, -0.032671095732758726, 0.27741804777843926, -0.2462256039752849, -0.33393767876782454, 0.21441303435631498, -0.11850083985038898, -0.03967858534650998, 0.2977734036888733, -0.07058909997674838, -0.0022654223449396073, -0.02586403933559149, 0.20486976915136024, 0.2966233190332648, 0.04177941957014071, 0.21764729415910475, -0.025092142037730227, 0.17163237179692947, 0.11997278260830645, -0.07615439226355539, 0.0261314493199488, -0.15356568426531295, 0.09967962601538949, 0.2598442939956986, 0.8427169984813664, 0.6169349144040905, 0.5036227595579071, 0.5377531315820535, 0.16415660432358967, 0.1733567769714471, 0.45737778719737066, 0.18327286180907817, 0.29570703725567443, -0.4792798825992675, -0.2433079890358554, -0.21590535079670806, -0.18353600013715182, -0.2455821674299002, -0.15063085896727652, 0.0893501911392047, 0.45588619476460385, -0.041452615947656084, 0.17797873414790397, 0.05779232126303889, -0.18182578897404478, 0.08847803083036195, 0.15546773831544983, -0.15630997230519, -0.08446943283313389, -0.07525253820998264, 0.15356495110425886, -0.0007154044050598945, -0.04593991693850121, -0.060388581873201876, -0.13480118369148664, 0.009633004752043125, 0.013220797817577984, -0.27004657439639285, 0.25137564235393495, 0.07124726190495759, 0.24815544788528865, 0.24819575714739883, 0.11828997652562667, 0.12705076421056063, -0.040513561629819075, 0.14037642912223347, -0.14146186520183915, -0.1599144022459988, 0.07287328535926697, 0.07389449299301878, -0.14386426642023198, 0.021218673925280953, 0.2504307822460211, -0.1687198235732759, -0.21294201894262585, -0.137018995736734, 0.2093603269195714, 0.08359028507010376, -0.03049475517509942, -0.09453671740645363, 0.2939099611083915]}],\n",
              "                        {\"coloraxis\": {\"colorbar\": {\"title\": {\"text\": \"color\"}}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"legend\": {\"tracegroupgap\": 0}, \"margin\": {\"t\": 60}, \"scene\": {\"domain\": {\"x\": [0.0, 1.0], \"y\": [0.0, 1.0]}, \"xaxis\": {\"title\": {\"text\": \"x\"}}, \"yaxis\": {\"title\": {\"text\": \"y\"}}, \"zaxis\": {\"title\": {\"text\": \"z\"}}}, \"template\": {\"data\": {\"bar\": [{\"error_x\": {\"color\": \"#2a3f5f\"}, \"error_y\": {\"color\": \"#2a3f5f\"}, \"marker\": {\"line\": {\"color\": \"#E5ECF6\", \"width\": 0.5}}, \"type\": \"bar\"}], \"barpolar\": [{\"marker\": {\"line\": {\"color\": \"#E5ECF6\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"#2a3f5f\"}, \"baxis\": {\"endlinecolor\": \"#2a3f5f\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"#2a3f5f\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"choropleth\"}], \"contour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"contour\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"contourcarpet\"}], \"heatmap\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmap\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"heatmapgl\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"histogram\"}], \"histogram2d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2d\"}], \"histogram2dcontour\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"histogram2dcontour\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"parcoords\"}], \"pie\": [{\"automargin\": true, \"type\": \"pie\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter\"}], \"scatter3d\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scattermapbox\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolar\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterpolargl\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}, \"colorscale\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"#EBF0F8\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"#C8D4E3\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowcolor\": \"#2a3f5f\", \"arrowhead\": 0, \"arrowwidth\": 1}, \"coloraxis\": {\"colorbar\": {\"outlinewidth\": 0, \"ticks\": \"\"}}, \"colorscale\": {\"diverging\": [[0, \"#8e0152\"], [0.1, \"#c51b7d\"], [0.2, \"#de77ae\"], [0.3, \"#f1b6da\"], [0.4, \"#fde0ef\"], [0.5, \"#f7f7f7\"], [0.6, \"#e6f5d0\"], [0.7, \"#b8e186\"], [0.8, \"#7fbc41\"], [0.9, \"#4d9221\"], [1, \"#276419\"]], \"sequential\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]], \"sequentialminus\": [[0.0, \"#0d0887\"], [0.1111111111111111, \"#46039f\"], [0.2222222222222222, \"#7201a8\"], [0.3333333333333333, \"#9c179e\"], [0.4444444444444444, \"#bd3786\"], [0.5555555555555556, \"#d8576b\"], [0.6666666666666666, \"#ed7953\"], [0.7777777777777778, \"#fb9f3a\"], [0.8888888888888888, \"#fdca26\"], [1.0, \"#f0f921\"]]}, \"colorway\": [\"#636efa\", \"#EF553B\", \"#00cc96\", \"#ab63fa\", \"#FFA15A\", \"#19d3f3\", \"#FF6692\", \"#B6E880\", \"#FF97FF\", \"#FECB52\"], \"font\": {\"color\": \"#2a3f5f\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"#E5ECF6\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"white\"}, \"hoverlabel\": {\"align\": \"left\"}, \"hovermode\": \"closest\", \"mapbox\": {\"style\": \"light\"}, \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"#E5ECF6\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}, \"bgcolor\": \"#E5ECF6\", \"radialaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"#E5ECF6\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"backgroundcolor\": \"#E5ECF6\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"white\"}, \"zaxis\": {\"backgroundcolor\": \"#E5ECF6\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"ticks\": \"\", \"zerolinecolor\": \"white\"}}, \"shapedefaults\": {\"line\": {\"color\": \"#2a3f5f\"}}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}, \"baxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}, \"bgcolor\": \"#E5ECF6\", \"caxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\"}}, \"title\": {\"x\": 0.05}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"white\", \"zerolinewidth\": 2}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"ticks\": \"\", \"title\": {\"standoff\": 15}, \"zerolinecolor\": \"white\", \"zerolinewidth\": 2}}}},\n",
              "                        {\"responsive\": true}\n",
              "                    ).then(function(){\n",
              "                            \n",
              "var gd = document.getElementById('a5bb86b5-d149-4f7a-b5bb-c4d4dd08aa21');\n",
              "var x = new MutationObserver(function (mutations, observer) {{\n",
              "        var display = window.getComputedStyle(gd).display;\n",
              "        if (!display || display === 'none') {{\n",
              "            console.log([gd, 'removed!']);\n",
              "            Plotly.purge(gd);\n",
              "            observer.disconnect();\n",
              "        }}\n",
              "}});\n",
              "\n",
              "// Listen for the removal of the full notebook cells\n",
              "var notebookContainer = gd.closest('#notebook-container');\n",
              "if (notebookContainer) {{\n",
              "    x.observe(notebookContainer, {childList: true});\n",
              "}}\n",
              "\n",
              "// Listen for the clearing of the current output cell\n",
              "var outputEl = gd.closest('.output');\n",
              "if (outputEl) {{\n",
              "    x.observe(outputEl, {childList: true});\n",
              "}}\n",
              "\n",
              "                        })\n",
              "                };\n",
              "                \n",
              "            </script>\n",
              "        </div>\n",
              "</body>\n",
              "</html>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "<Figure size 1008x576 with 0 Axes>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    }
  ]
}